#!/bin/bash

if [ -z $1 ]; then
echo 'missing a parameter'
echo 'HELP:'
echo gen : sencha generate app $2 ../$2
echo prod : sencha app build production
echo package : sencha app build package
echo css : compass compile resources/sass/
echo watch : compass watch resources/sass/
echo android : sencha app package run android
echo apro : sencha app production run android
echo ios : sencha app package run ios
echo genkey : create project release key
exit
fi


if [ $1 = ios ]; then
echo sencha app build package
echo copy build-ios.xml
cp ../../../build/build-ios.xml ./build.xml

rm _ios.built
 
rm -Rf build/archive
rm -rf build/${PWD##*/}/ios/
rm -rf build/production 

 
##rm -Rf archive
## if [ -z $2 ]; then
##    rm -rf build/${PWD##*/}/
## else
##    rm -rf build/$2
## fi 
##rm -Rf archive
 
sencha app build production
fi


 
echo success!

 say success! 
 ##&afplay ~/bin/notice.mp3 &
